<template>
    <!-- 页面头部 -->
    <HomePageHead></HomePageHead>
    <!-- 导航栏 -->
    <HomePageNavigation1></HomePageNavigation1>
    <!-- 列表页广告一 -->
    <HomeTopTen :imgurl="adList[0]" v-if="adList[0]"></HomeTopTen>
    <!-- 面包屑导航 -->
    <div class="breadcrumb">
        <div class="inner">
            <span class="location">当前位置:</span>
            <el-breadcrumb :separator-icon="ArrowRight">
                <el-breadcrumb-item>
                    <NuxtLink to="/">首页</NuxtLink>
                </el-breadcrumb-item>
                <el-breadcrumb-item  v-show="name">
                    <NuxtLink :to="{ path: `/primaryNavigation/${listid}`}">{{name}}</NuxtLink>
                </el-breadcrumb-item>
                <el-breadcrumb-item>
                    {{ newsDetail.con_title }}
                </el-breadcrumb-item>
            </el-breadcrumb>
        </div>
    </div>
    <!-- 资讯列表 -->
    <div class="newsDetail">
        <div class="inner">
            <div class="innerLeft">
                <div class="leftBottomTitle">{{ newsDetail.con_title }}</div>
                <div class="leftBottom" v-html="newsDetail.content" v-if="newsDetail.content"></div>
            </div>
            <div class="innerRight">
                <div class="rightMenuTitle">导航列表</div>
                <ul>
                    <li v-for="(item, index) in bottomMenu" :key="index">
                        <NuxtLink :to="`/speciaArticle/${item.id}`" :title="item.name"
                            v-if="item.id == pageId && item.id != 7" class="active">
                            {{ item.name }}
                        </NuxtLink>
                        <NuxtLink :to="`/speciaArticle/${item.id}`" :title="item.name"
                            v-else-if="item.id != pageId && item.id != 7">
                            {{ item.name }}
                        </NuxtLink>
                        <NuxtLink :to="`/specialList/${item.id}`" :title="item.name"
                            v-if="item.id == 7 && pageId == 7 && routeHref == '/specialList/7'" class="active">
                            {{item.name }}
                        </NuxtLink>
                        <NuxtLink :to="`/specialList/${item.id}`" :title="item.name" v-else-if="item.id == 7">
                            {{ item.name}}
                        </NuxtLink>
                    </li>
                </ul>
            </div>
            <div style="clear: both;"></div>
        </div>
    </div>
    <!-- 广告二 -->
    <HomeTopTen :imgurl="adList[1]" v-if="adList[1]"></HomeTopTen>
    <!-- 页面底部 -->
    <HomeFoot1></HomeFoot1>
</template>

<script setup>
//1.页面依赖 start ---------------------------------------->
import { ElBreadcrumb, ElBreadcrumbItem } from 'element-plus'
import { ArrowRight } from '@element-plus/icons-vue'

//获得跳转过来的id
const route = useRoute();
const articleId = route.params.id; //获得该页面的id
const listid = route.query.listId; //获得该页面的id
const name = route.query.listName; //获得该页面的id
const pageId = route.params.id; //获得该页面的id
const routeHref = route.href;
//1.页面依赖 end ---------------------------------------->

//2.页面数据 start ---------------------------------------->
//广告列表
let adList = ref([]);
async function getAdData(){
    const adData = await requestDataPromise('/web/getWebsiteAdvertisement',{method:'GET',query:{'ad_tag':'PAGE'}});
    adList.value = adData.data;
}
getAdData();

const newsDetail = ref({})
const bottomMenu = ref([]);

async function getPageData() {
    const mkdata =  await requestDataPromise('/web/getWebsiteFooterCategoryInfo', {
        method: 'GET',
        query: {
            'fcat_id': articleId
        },
    });
    newsDetail.value = mkdata.data;
}
getPageData();

async function getPageMenu() {
    const mkdata =  await requestDataPromise('/web/getWebsiteFooterCategory', {
        method: 'GET',
        query: {},
    });
    bottomMenu.value = mkdata.data;
}
getPageMenu();
//2.页面数据 end ---------------------------------------->


//4.设置seo信息 start---------------------------------------->
//4.1 设置seo信息
const setData =  await requestDataPromise('/web/getWebsiteFootInfo', {
    method: 'GET',
    query: {},
});

let seoTitle = setData.data.website_head.title;
let seoDescription = setData.data.website_head.description;
let seoKeywords = setData.data.website_head.keywords;

useSeoMeta({
    title: seoTitle,
    meta: [
        { name: 'description', content: seoDescription },
        { name: 'keywords', content: seoKeywords }
    ]
});
//4.设置seo信息 end---------------------------------------->
</script>

<style lang="less" scoped>
//导航条
.breadcrumb {
    width: 100%;
    height: 22px;
    margin-bottom: 30px;
    font-family: Microsoft YaHei, Microsoft YaHei;
    font-weight: 400;
    font-size: 20px;
    color: #666666;
    line-height: 23px;
    text-align: left;
    font-style: normal;
    text-transform: none;

    .el-breadcrumb::v-deep {
        display: inline-block;
        vertical-align: -4px;
    }

    /deep/.el-breadcrumb__inner a,
    /deep/.el-breadcrumb__inner.is-link {
        color: #666666;
        font-weight: 400;
        text-decoration: none;
        transition: var(--el-transition-color);
    }

    span {
        font-family: Microsoft YaHei, Microsoft YaHei;
        font-weight: 400;
        font-size: 20px;
        color: #666666;
        line-height: 23px;
        text-align: left;
        font-style: normal;
        text-transform: none;
    }

    span:hover {
        color: #666666;
    }

    .location {
        margin-right: 20px;
        width: 100px;
        height: 22px;
        font-family: Microsoft YaHei, Microsoft YaHei;
        font-weight: 400;
        font-size: 20px;
        color: #666666;
        line-height: 23px;
        text-align: left;
        font-style: normal;
        text-transform: none;
    }
}

// 资讯列表
.newsDetail {
    width: 100%;
    //height: 1400px;
    margin-bottom: 70px;

    .inner {
        width: 1200px;
        //height: 1400px;
        font-size: 16px;

        .innerLeft {
            //height: 1400px;

            float: right;

            .LeftTop {
                //height: 522px;
                margin-top: 50px;

                >h1 {

                    line-height: 40px;
                    margin-bottom: 30px;
                    font-family: Microsoft YaHei, Microsoft YaHei;
                    font-weight: bold;
                    font-size: 30px;
                    color: #333333;
                }

                >p {
                    height: 18px;
                    line-height: 18px;
                    font-family: Microsoft YaHei, Microsoft YaHei;
                    font-weight: 400;
                    font-size: 14px;
                    color: #999999;

                    span {
                        margin-right: 40px;
                    }
                }

                >img {
                    width: 680px;
                    height: 382px;
                    padding: 50px 0px 60px 55px;
                }
            }

            .leftBottomTitle {
                color: #028E21;
                font-size: 24px;
                font-weight: bold;
                height: 60px;
                line-height: 60px;
            }

            .leftBottom {
                width: 790px;
                font-size: 20px;
                border-top: 1px solid #139602;
                padding-top: 40px;

                >h3,
                >p {
                    text-indent: 2em;
                    width: 790px;
                    font-family: Microsoft YaHei, Microsoft YaHei;
                    font-size: 20px;
                    color: #333333;
                    line-height: 23px;
                    padding-bottom: 30px;
                }

                >h3 {
                    font-weight: 600px;
                }

                >p {
                    font-weight: 400;
                }

            }
        }


        .innerRight {
            width: 279px;

            .rightMenuTitle {
                width: 279px;
                height: 69px;
                font-size: 22px;
                font-weight: bold;
                line-height: 58px;
                text-align: center;
                color: #fff;
                background: url("../../public/special/projectMoreTitle.png") no-repeat;
                margin-bottom: 30px;
            }

            ul {
                li {
                    a {
                        border-left: 5px solid #028E21;
                        margin-bottom: 15px;
                        font-size: 22px;
                        display: block;
                        height: 61px;
                        line-height: 61px;
                        color: #333333;
                        text-align: center;
                        background: #FBFBFB;
                    }
                }
            }

            .active {
                border-left: 0;
                border: 1px solid #028E21;
                background: #fff;
            }
        }
    }
}
</style>